﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace EnergyManagement.UControls
{
    //圆角按钮
    public partial class CircleButton: Button
    {
        public CircleButton()
        {
            InitializeComponent();
            SetStyle(ControlStyles.Selectable, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint,true);//忽略窗口信息，减少闪烁
            SetStyle(ControlStyles.OptimizedDoubleBuffer, true);//绘制到缓冲区，减少闪烁
            SetStyle(ControlStyles.UserPaint, true);//空间由其自身而不是操作系统绘制
            SetStyle(ControlStyles.ResizeRedraw, true);//调整大小时重新绘制控件
            SetStyle(ControlStyles.SupportsTransparentBackColor, true);//支持透明背景
        }
    }
}
